﻿using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour {

	public float vel;
	public float rotvel;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {

		Vector3 pos = Vector3.zero;
		Vector3 rot = Vector3.zero;

		if(Input.GetKey(KeyCode.W)) pos.z += vel * Time.deltaTime;
		if(Input.GetKey(KeyCode.S)) pos.z -= vel * Time.deltaTime;
		if(Input.GetKey(KeyCode.RightArrow)) rot.y += rotvel * Time.deltaTime;
		if(Input.GetKey(KeyCode.LeftArrow)) rot.y -= rotvel * Time.deltaTime;

		transform.Rotate(rot);
		transform.Translate(pos);
	}
}
